<style lang="less" scoped src="./level.less"></style>
<script src="./level.js"></script>

<template>
    <div>
        <Row style="font-size: 15px;">
            <!--机构名称：<Input v-model="queryCon.organizename" clearable style="width: 15%"></Input>-->
            <!--<span @click="loadList"><Button type="primary" icon="android-search">查询</Button></span>-->
        </Row>
        <Row>
            <span @click="showAdd"><Button type="primary" icon="android-add">新增</Button></span>
        </Row>
        <div class="main-table">
            <Table border :columns="columns" :data="data"></Table>
        </div>
        <div class="pagination">
            <Page :total="total" size="small" :page-size="pageSize" :current.sync="pageIndex" @on-change="loadList" show-total show-elevator></Page>
        </div>
        <Modal
                v-model="viewModalVisible"
                title="级别信息"
                @on-ok="viewModalVisible = false"
                @on-cancel="viewModalVisible = false"
                width="40%">
            <Form :model="formData" :label-width="90">
                <Row >
                    <Col span="18">
                    <FormItem label="机构名称">
                        <div class="conts">{{formData.organizename}}</div>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="18">
                    <FormItem label="创建时间">
                        <div class="conts">{{formData.createTime}}</div>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="18">
                    <FormItem label="级别">
                        <div class="conts">{{formData.level}}</div>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="18">
                    <FormItem label="奖状数量">
                        <div class="conts">{{formData.diplomasun}}</div>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="18">
                    <FormItem label="主题数量">
                        <div class="conts">{{formData.themesun}}</div>
                    </FormItem>
                    </Col>
                </Row>
            </Form>
        </Modal>
        <Modal v-model="saveModalVisible" :title="(formData.id ? '修改' : '新增') + '级别信息'" width="40%" @on-cancel="saveModalVisible = false">
            <Form :model="formData" :label-width="125">
                <Row>
                    <Col span="18">
                    <FormItem label="机构名称">
                        <Select v-model="formData.orgId" filterable clearable>
                            <Option v-for="item in organizeList" :value="item.id" :key="item.id">{{ item.orgName }}</Option>
                        </Select>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="18">
                    <FormItem label="级别">
                        <InputNumber v-model="formData.level"
                                     :min="0"
                                     :precision="0"
                                     style="width: 100%"
                        ></InputNumber>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="18">
                    <FormItem label="奖状数量">
                        <InputNumber v-model="formData.diplomasun"
                                     :min="0"
                                     :precision="0"
                                     style="width: 100%"
                        ></InputNumber>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="18">
                    <FormItem label="级别数量">
                        <InputNumber v-model="formData.themesun"
                                     :min="0"
                                     :precision="0"
                                     style="width: 100%"
                        ></InputNumber>
                    </FormItem>
                    </Col>
                </Row>
            </Form>

            <div slot="footer">
                <Button type="primary" @click="activitySave">保存</Button>
                <Button type="ghost" style="margin-left: 8px" @click="saveModalVisible = false">取消</Button>
            </div>
        </Modal>
    </div>
</template>